package com.wyp.demo.utils;

import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.cookie.Cookie;
import org.apache.http.impl.client.DefaultHttpClient;

import android.content.ContentValues;
import android.content.Context;
import android.webkit.CookieManager;

public class HttpCookieUtil {
		private String urlPath="http://etv.easy3c.net";
//		HttpClient httpClient = HttpCookieUtil.getHttpClient();
//    public void addCookie(String mac,String udid){
//    	ContentValues cookieVal = new ContentValues();
//    	cookieVal.put("uid", mac);
//    	cookieVal.put("udid", udid);
//    	DefaultHttpClient httpclient = new DefaultHttpClient();
//    	HttpGet httpget = new HttpGet("http://etv.easy3c.net");
//    	HttpResponse response = httpclient.execute(httpget);
//    	Cookie uidcookie = new Cookie("uid",mac);
//    	Cookie udidcookie = new Cookie("udid",udid);
//    	uidcookie.
//    	response.addCookie(uidcookie);
//    	response.addCookie(udidcookie);
//
//
//    	
//    }
//    void getCookie(Context context){
//    	URL url;
//		try {
//			url = new URL(urlPath);
//			HttpURLConnection httpUrlConn = (HttpURLConnection) url.openConnection();   
//	    	httpUrlConn.setDefaultRequestProperty("cookie", getCookie(context)); 
//	    	CookieManager cookieManager = CookieManager.getInstance();   
//	    	String cookie = cookieManager.getCookie("cookie");     
//	    	cookie= "XXX";   
//	    	cookieManager.setCookie("cookie", cookie);
//		} catch (MalformedURLException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}	   
//    }
}
